<!DOCTYPE html>
<html>

<head>
  <title></title>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <link href="../bootstrap-5.1.3-dist/css/bootstrap.css" rel="stylesheet">
  <script src="../bootstrap-5.1.3-dist/js/bootstrap.bundle.min.js"></script>
</head>

<body class="container">
  <div class="alert alert-warning fade show">
    <strong>警告提示！</strong> 程序中出现一个语法问题。
    <button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="Close"></button>
  </div>

</body>
<script>
  var alertNode = document.querySelector('.alert')
  var alert = bootstrap.Alert.getInstance(alertNode)
  alert.close()
</script>

</html>